package cn.tedu.mybatis.pojo;

import java.util.Date;

/**
 * 该类用于表示blog表
 * CREATE TABLE blog(
 *     id INT PRIMARY KEY AUTO_INCREMENT,
 *     content VARCHAR(255),
 *     created TIMESTAMP,
 *     user_id INT
 * );
 */
public class Blog {
    private Integer id;
    private String content;
    private Date created;
    private Integer userId;//一般有下划线都用驼峰命名法

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreated() {
        return created;
    }

    public void setCreated(Date created) {
        this.created = created;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "Blog{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", created=" + created +
                ", userId=" + userId +
                '}';
    }
    //注意输出  构造会自动调用toSting 来输出结果
    //这些输出正是通过 Blog 的 toString() 方法生成的。
    // 它帮助你在调试或日志中清晰地看到对象的内容，而不是默认的哈希地址（如 BlogVO2@1b6d3586）
}
